package com.hue.springbootmybatis.plugins;

import java.util.function.Function;

/**
 * @Author: 姚凤桥
 * @Date: 2022/5/26 8:30
 * @Description:
 */
public enum TuominStrategy {
    /**
     * 保留首尾两个字符,中间替换为*
     */
    NAME(origin -> origin.replaceAll("(\\S)\\S(\\S*)", "$1*$2"));

    private final Function<String, String> strategy;

    TuominStrategy(Function<String, String> strategy) {
        this.strategy = strategy;
    }

    public Function<String, String> getStrategy() {
        return strategy;
    }
}
